import axios from "axios";
import store from "@/store";
import router from "@/router";
import { Message } from "element-ui";
const request = axios.create({
  baseURL: process.env.VUE_APP_URL,
});
request.defaults.withCredentials = true;

request.interceptors.request.use(
  (config) => {
    return config;
  },
  (error) => {
    // Do something with request error
    return Promise.reject(error);
  }
);

request.interceptors.response.use(
  (response) => {
    return response.data;
  },
  (error) => {
    // Do something with response error
    return Promise.reject(error);
  }
);

export default request;
